#include <stdlib.h>
#include <iostream>
#include <fstream>
#include "stdio.h"

using namespace std;

int N, lx, ly, lz;
double *x, *y, *z;
int *dist;

void initial()
{
	cout << " N: ";
	cin >> N;

	cout << " lx: ";
	cin >> lx;

	cout << " ly: ";
	cin >> ly;

	cout << " lz: ";
	cin >> lz;

	x = new double[N];
	y = new double[N];
	z = new double[N];

	ifstream flIn;
	flIn.open("input.txt");

	for (int i = 0; i < N; ++i)
	{
		flIn >> x[i];
		flIn >> y[i];
		flIn >> z[i];
	}

	flIn.close();
}

void destruction()
{
	delete[] x;
	delete[] y;
	delete[] z;
	delete[] dist;
}

int main()
{	
	double dx;
	double dy;
	double dz;
	double r;
	int place;
	
	initial();

	int size = 10*sqrt(lx*lx/4 + ly*ly/4 + lz*lz);
	dist = new int[size];
	for (int i = 0; i < size; ++i)
	{
		dist[i] = 0;
	}

	for (int i = 0; i < N - 1; ++i)
	{
		for (int j = i + 1; j < N; ++j)
		{
			dx = x[i] - x[j];
			dy = y[i] - y[j];
			dz = z[i] - z[j];

				if ( fabs(dx) > .5*lx )
				{
					if ( dx > 0 )
						dx = dx - lx;
					else
						dx = dx + lx;
				}

				if ( fabs(dy) > .5*ly )
				{
					if ( dy > 0 )
						dy = dy - ly;
					else
						dy = dy + ly;
				}

			r = 10*sqrt( dx*dx + dy*dy + dz*dz );

			if (r >= size)
			{
				place = size - 1;
			}
			else
			{
				place = (int)r;
			}

			dist[place]++;
		}
	}

	ofstream flOut;
	flOut.open("output.txt");
		for (int i = 0; i < size; i++)
		{
			flOut << dist[i] << endl;
		}
	flOut.close();

//	destruction();

	return 0;
}